import { actionTypes} from "../actions/actionTypes";

const data = {
    number: 1
}

export default (state = data, action) => {
    switch (action.type) {
        case actionTypes.add: return Object.assign({},state,{number: state.number + action.number});
        case actionTypes.reduce: return Object.assign({},state,{number: state.number - action.number});
        default:
            return state
    }
}